package net.sxnic.item.zzdw.util;

import java.util.Map;

import net.sxnic.item.ItemConstants;

public class ZzdwUtils {

	public static String crtZzdwSelectHtml(String name, String value) {

		StringBuilder sb = new StringBuilder();
		sb.append("<select id='" + name + "_id' name='" + name + "' >");
		sb.append("<option value=''>请选择组织单位</option>");

		Map<String,String> map = ItemConstants.ZZDW_MAP.get(ItemConstants.SYSTEM_CALALOG_ALIAS);
		for (String code : map.keySet()) {
			if (code.equals(value)) {
				sb.append("<option value='" + code + "' selected>"
						+ map.get(code) + "</option>");
			} else {
				sb.append("<option value='" + code + "'>"
						+ map.get(code) + "</option>");
			}
		}

		sb.append("</select>");

		return sb.toString();
	}
}
